package com.miao.im.support.exception;

import com.miao.im.common.BizCode;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @description： 通用业务异常
 */
@Getter
public class BizException extends RuntimeException {
    /**错误code码*/
    private int code;

    /** */
    private static final long serialVersionUID = 4248326393464652492L;

    public BizException(int code, String msg) {
        super(msg.replace("{}", ""));
        this.code = code;
    }

    public BizException(String msg) {
        super(msg.replace("{}", ""));
        this.code = BizCode.GENERAL_ERROR;
    }

    public BizException(String msg, Object... obj) {
        super(msg.replace("{}", ""));
        this.code = BizCode.GENERAL_ERROR;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }

}
